package com.controller;

import java.util.concurrent.atomic.AtomicLong;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.service.IUserService;

@RestController
@RequestMapping("/test")
public class GreetingController {

    private static final String template = "Hello, %s!";
    private final AtomicLong counter = new AtomicLong();
    @Autowired
    IUserService userService;

    @RequestMapping("/greeting")
    public String greeting1(@RequestParam(value = "id") Long uid) {
        return JSON.toJSONString(userService.getUserById(uid));
    }
}